package com.usian.controller;

import com.usian.pojo.poste.Poste;
import com.usian.service.PosteService;
import com.usian.vo.StaffVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/poste")
public class PosteController {

    @Autowired
    private PosteService posteService;

    @RequestMapping("/al")
    public String al(Model model,Integer depId){
        List<Poste> als = posteService.findAl(depId);
        model.addAttribute("als",als);
        return "al";
    }

    @RequestMapping("/dele")
    public String dele(Integer  id){
        posteService.delet(id);
        return "redirect:/poste/al";
    }


}
